<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
   <div id="vue">
       <p v-rr>12123123213213</p>
       <p v-hh>12123123213213</p>
       <p v-color="colors">2112312313</p>
   </div>

</body>
<script>
    //全局自定义指令
    Vue.directive("rr",{
        inserted:function (el) {
            el.style.color = "yellow";
        }
    });
    var app = new Vue({
        el:"#vue",
        data:{
             msg:"upload",
             inp_val:"",
            colors:"yellow"
        },
        //局部自定义指令
        directives:{
            hh:function (el) {
                el.style.color = "red";
            },
            color:function (el,val) {
                el.style.color = val.value;
            }
        }
    });


</script>
</html>